import com.bird { Runtime, Interface }
import com.bird.intent { Intent }
import com.bird.os.service { ServiceManager }
import com.bird.os.security { SecurityManager }
import com.bird.os.service.ui {UiService}
import com.bird.os.service.activity { ActivityService }

shared class Kernel() extends Runtime() {
	
	variable ServiceManager _serviceManager := ServiceManager();
	variable SecurityManager _securityManager := SecurityManager();
	
	shared actual Interface executeIntent(Intent intent) {
		this._securityManager.validateIntent(intent);
		return _serviceManager.executeIntent(intent);
	}
	
	shared void start() {
		print("Bird Kernel Started");
		print("Starting basic services...");		
		
		_serviceManager.putService(Entry(className(UiService), UiService(this)));
		_serviceManager.putService(Entry(className(ActivityService), ActivityService(this)));
		_serviceManager.start();
		
		print("Done.");
		print("Bird is ready to Work.");
	}
}